<?php
namespace App\Services\ThirdPayments\BankTraits;

use App\Lib\BankMap;

trait HCADBankMap
{
    private $bankMap = [
        BankMap::GONGSHANG  => '1002',
        BankMap::NONGYE     => '1005',
        BankMap::CHINABANK  => '1052',
        BankMap::JIANSHE    => '1003',
        BankMap::ZHAOSHANG  => '1001',
        BankMap::PUFA       => '1004',
        BankMap::GUANGFA    => '1027',
        BankMap::JIAOTONG   => '1020',
        BankMap::YOUZHEN    => '1028',
        BankMap::ZHONGXIN   => '1021',
        BankMap::MINSHENG   => '1006',
        BankMap::GUANGDA    => '1022',
        BankMap::HUAXIA     => '1025',
        BankMap::XINGYE     => '1009',
        BankMap::SHANGHAI   => '1024',
        BankMap::PINGAN     => '1010',
        BankMap::BEIJING    => '1032'
    ];

    public function getBank($bankCode)
    {
        if (array_key_exists($bankCode, $this->bankMap)) {
            return $this->bankMap[$bankCode];
        } else {
            return '1001';
        }
    }
}
